package com.tql.mall.boss.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tql.mall.boss.mapper.BaseTrademarkMapper;
import com.tql.mall.boss.service.BaseTrademarkService;
import com.tql.mall.model.product.BaseTrademark;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BaseTrademarkServiceImpl extends ServiceImpl<BaseTrademarkMapper, BaseTrademark> implements BaseTrademarkService {
    @Override
    public BaseTrademark getById(Long id) {
        return baseMapper.selectById(id);
    }



    /**
     * 品牌分页列表查询
     * @param baseTrademarkPage
     * @return
     */
    @Override
    public IPage<BaseTrademark> getBaseTrademakrPage(Page<BaseTrademark> baseTrademarkPage) {

        //排序
        QueryWrapper<BaseTrademark> queryWrapper=new QueryWrapper<>();
        queryWrapper.orderByAsc("id");

        return baseMapper.selectPage(baseTrademarkPage,queryWrapper);
    }

    @Override
    public List<BaseTrademark> getTrademarkList() {
        return baseMapper.selectList(new QueryWrapper<>());
    }
}
